Repository navigation
Conversation
angus-g
force-pushed
the
angus-g/4638-project
branch
2 times, most recently
from
October 19, 2026 03:00
9c2b031 to
77f178f
Compare
angus-g
force-pushed
the
angus-g/4638-remove-blocks
branch
from
October 19, 2026 03:12
244e154 to
4865de5
Compare
Comment on lines
+14
to
+15
| if issubclass(type(block), CachedSolverBlock) | ||
| and not getattr(block, "_is_project", False) |
Member
There was a problem hiding this comment.
Firedrake generally views conditionally present attributes as bad code style. is_project should be set on all solver block types if we need to detect it.
Contributor
Author
There was a problem hiding this comment.
Given the mixin is generating a ProjectBlock directly, this is outdated.
Member
|
I like that diff line count! The |
The ProjectBlock was essentially an extension of SolveVarFormBlock that sets up the mass matrix system for the adjoint machinery. For the original (forward) project() call, the "proper" form is used, but the forward solver on the tape uses a simplified mass matrix. The approach here replicates that behaviour, but it's routed through the new CachedSolverBlock. As a consequence however, we have annotation on the Projector factory, which means that adjoint-friendly projection can occur through either the bare project() call, or by creating a Projector object. The SupermeshSolveBlock is actually a standalone object, so we just create that when SupermeshProjector.project() is called. Again, this allows for both bare and object-based projection to be taped. The final case is the "null" project from one function to another on the same space. This creates an Assigner, and I assume it will "just work" through the annotation on assign().
angus-g
force-pushed
the
angus-g/4638-project
branch
from
November 13, 2026 05:53
77f178f to
e216e83
Compare
The NLVS mixin has a static method _ad_block_type() that determines what type of block to create on the tape. This is overridden to ProjectBlock for projection operations. An accompanying test for the get_solve_blocks() method has been added.
Also adds a test that verifies this actually works.
Here, the top-level annotate_project is acting more like a boundary on the annotate=False argument.
angus-g
force-pushed
the
angus-g/4638-project
branch
from
November 14, 2026 04:23
2d7e153 to
a0eb14e
Compare
Now that the original namespace is clear, we can use a more descriptive name for the block!
angus-g
force-pushed
the
angus-g/4638-remove-blocks
branch
from
November 14, 2026 04:58
19c9086 to
ecd1467
Compare
Base automatically changed from
angus-g/4638-project
to
JHopeCollins/nlvs-hessian-fix
November 15, 2026 12:51
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This excises the
NonlinearVariationalSolveBlock, theGenericSolveBlock, and its subclasses theSolveVarFormBlockandProjectBlock. There's a bit of hackery to makeget_solve_blockskind of still work without fulling threading projector-ness through the solve machinery.